<template>
	<view class="_approval_item">
		<view class="u-p-l-32 u-p-r-32 ">
			<view class="u-flex u-flex-between u-flex-items-center">
				<view class="f-s-16 f-w-b u-m-r-40 u-line-1">{{ info.title }}</view>

				<status-tag type="card" :history="props.history" :status="info.status"></status-tag>

			</view>
			<view class="u-m-t-24 f-s-14 u-flex u-flex-self-start">
				<view class="_title u-tips-color">提交人</view>
				<view>{{ info.userName }}
					<text v-if="info.deptName">（{{ info.deptName }}）</text>
				</view>
			</view>
			<view class="u-m-t-16 f-s-14 u-flex">
				<view class="_title u-tips-color">提交时间</view>
				<view>{{ info.createAt }}</view>
			</view>
			<!-- <view class="u-m-t-16 f-s-14 u-flex">
				<view class="_title u-tips-color">下级审批</view>
				<view>暂无</view>
			</view> -->
			<view class="u-m-t-16 f-s-14 u-flex">
				<view class="_title u-tips-color">具体内容</view>
				<view>{{ info.content }}</view>
			</view>
		</view>
		<up-line  margin="24rpx 0 "></up-line>
		<view class="u-flex u-flex-end u-flex-items-center u-p-l-32 u-p-r-32">
			<view>
				<up-button text="详情" :customStyle="{
					width: '120rpx',
					height: '56rpx',
					background: '#1677FF',
					borderRadius: '8rpx',
					fontSize: '28rpx',
					color: '#FFFFFF'
				}" @click="toInfo" ></up-button>
			</view>
		</view>
	</view>
</template>


<script setup>
	import { toast } from '../utils/common';
import StatusTag from '@/components/common/StatusTag.vue';
	
	const props = defineProps({
		info: Object,
		history: Boolean
	})
  setTimeout(()=>{
    console.log('::::::::::::')
    console.log(props)
  },1500)
	
	const toInfo = ()=>{
		// if(props.history){
			
			uni.navigateTo({
				url: '/subPackages/approval/info?id=' + props.info.id+'&history='+props.history
			})
			
		// 	return
		// }
		// toast('详情暂不支持查看')
	}
</script>

<style lang="scss" scoped>
	._approval_item {
		background: #FFFFFF;
		box-shadow: 0rpx 2rpx 20rpx 0rpx rgba(0, 0, 0, 0.05);
		border-radius: 16rpx;
		padding: 32rpx 0;
		margin-bottom: 24rpx;
		
		._title{
			min-width: 144rpx;
			width: 144rpx;
		}
		
	}
</style>